package com.example.utils;

import com.example.entity.Account;

/**
 * @Author: yudaxian
 * @Description: TODO
 * @DateTime: 2024/9/23 23:46
 **/
public class UserThreadLocal {

    // 不希望被实例化
    private UserThreadLocal() {}

    private static final ThreadLocal<Account> LOCAL = new ThreadLocal<>();

    public static void set(Account account) {
        LOCAL.set(account);
    }

    public static Account get() {
        return LOCAL.get();
    }

    public static void remove() {
        LOCAL.remove();
    }
}
